------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\mbeissin\Desktop\Stata files for book\Logfiles\chapter2.log
  log type:  text
 opened on:  25 Jan 2022, 19:18:36

. * ======================================================================
. * STATISTICAL RESULTS APPEARING IN CHAPTER 2, THE REVOLUTIONARY CITY
. * Results reported in Chapter 2 
. * Author: Mark R. Beissinger  
. * Date:  January 2022  
. * Princeton, NJ 
. * ======================================================================
. * BEFORE RUNNING, YOU MUST SET THE DEFAULT PATH FOR WHERE THE DATA
. *   FILES RESIDE
. * ======================================================================
. * The following datafiles were used in this chapter:
. *   Monitoring surveys (Ukraine)--monitoring20052014engmerged.dta
. *   2011 Arab Barometer--Tunisia and Egypt--fullarabbarom2.dta
. *   States and episodes--statesandepisodes.dta 
. *   Risk of revolutionary episodes--revspellsbase.dta
. *   Panel data for revolutionary episodes--revspredictbycntryyr.dta
. *   Data set of revolutionary episodes--revolutionaryeps.dta
. *   Data set of demonstrations in USSR during glasnost'--glasnostdemonstrations.dta
. *   World Survey Wave 6 (recoded by author for analysis)--worldvalues.wave6.2010-14.dta
. * =====================================================================
. * Before running, you must ensure that the following STATA package is installed:
. *   arpois from http://www.stata.com/stb/stb46
. * =====================================================================
. * Output produced:  Logfiles\chapter2.log
. *                                       Logfiles\figure2_4.pdf
. * =====================================================================
. 
. * ====================================================
. * OVERALL TEMPORAL PATTERNS OF REVOLUTIONARY EPISODES
. * ====================================================
. use statesandepisodes.dta 

. arpois newrevs1000  postcoldwar , ar(2) delete 
log-linear autoregressive model 2 order

(sum of wgt is 337.82355)

Iteration 0:   residual SS =  51.50028
Iteration 1:   residual SS =  40.36613

      Source |       SS       df       MS            Number of obs =       113
-------------+------------------------------         F(  3,   109) =     14.96
       Model |  16.6176418     3  5.53921393         Prob > F      =    0.0000
    Residual |  40.3661256   109  .370331428         R-squared     =    0.2916
-------------+------------------------------         Adj R-squared =    0.2721
       Total |  56.9837674   112  .508783637         Root MSE      =  .6085486
                                                     Res. dev.     =   206.848
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |   .9534147   .0717915    13.28   0.000     .8111263    1.095703
          X1 |    .469541    .119013     3.95   0.000     .2336612    .7054208
          R1 |   .3058279   .0927659     3.30   0.001     .1219688     .489687
          R2 |   .2489151   .0927863     2.68   0.008     .0650157    .4328145
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. arpois nocommnewrevs1000  postcoldwar , ar(2) delete 
log-linear autoregressive model 2 order

(sum of wgt is 320.82354)

Iteration 0:   residual SS =  48.17692
Iteration 1:   residual SS =  40.45838

      Source |       SS       df       MS            Number of obs =       113
-------------+------------------------------         F(  3,   109) =      9.08
       Model |  10.1158999     3  3.37196664         Prob > F      =    0.0000
    Residual |  40.4583768   109  .371177769         R-squared     =    0.2000
-------------+------------------------------         Adj R-squared =    0.1780
       Total |  50.5742767   112  .451556042         Root MSE      =  .6092436
                                                     Res. dev.     =  205.7338
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |   .9537271   .0700422    13.62   0.000     .8149057    1.092548
          X1 |   .3250954   .1219291     2.67   0.009     .0834359    .5667549
          R1 |   .2210648   .0921448     2.40   0.018     .0384369    .4036928
          R2 |   .2766456   .0923385     3.00   0.003     .0936336    .4596575
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. arpois ongoing1000 coldwar postcoldwar , ar(1) delete 
log-linear autoregressive model 1 order

(sum of wgt is 2023.3801)

Iteration 0:   residual SS =  18.15175
Iteration 1:   residual SS =  4.730537

      Source |       SS       df       MS            Number of obs =       114
-------------+------------------------------         F(  3,   110) =    346.76
       Model |  44.7374906     3  14.9124969         Prob > F      =    0.0000
    Residual |  4.73053719   110  .043004884         R-squared     =    0.9044
-------------+------------------------------         Adj R-squared =    0.9018
       Total |  49.4680278   113  .437770157         Root MSE      =  .2073762
                                                     Res. dev.     = -15.33416
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |    1.90715   .0485112    39.31   0.000     1.811012    2.003288
          X1 |   1.202351   .0576592    20.85   0.000     1.088084    1.316618
          X2 |   1.482565   .0565064    26.24   0.000     1.370582    1.594547
          R1 |   .8615686   .0487156    17.69   0.000     .7650258    .9581114
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. arpois nocommongoing1000 coldwar postcoldwar , ar(1) delete 
log-linear autoregressive model 1 order

(sum of wgt is 1972.3801)

Iteration 0:   residual SS =  16.49298
Iteration 1:   residual SS =  4.564498

      Source |       SS       df       MS            Number of obs =       114
-------------+------------------------------         F(  3,   110) =    334.38
       Model |  41.6254433     3  13.8751478         Prob > F      =    0.0000
    Residual |  4.56449792   110  .041495436         R-squared     =    0.9012
-------------+------------------------------         Adj R-squared =    0.8985
       Total |  46.1899412   113  .408760542         Root MSE      =  .2037043
                                                     Res. dev.     = -20.59323
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |   1.907038   .0470482    40.53   0.000     1.813799    2.000276
          X1 |   1.202489   .0559203    21.50   0.000     1.091668     1.31331
          X2 |     1.4264    .055227    25.83   0.000     1.316953    1.535847
          R1 |   .8508293   .0501258    16.97   0.000     .7514916    .9501669
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. 
. * ===================================================================
. * EFFECT OF STATE INDEPENDENCE ON OUTBREAK OF REVOLUTIONARY EPISODES
. * ===================================================================
. use "revspredictbycntryyr.dta", clear

. xtcloglog revny c.lnyrsindependent##c.lnyrsindependent time1 timesq timecub if year<1985, vce(robust) nolog efor
> m

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      7,367
Group variable: cowcode                         Number of groups  =        144

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       51.2
                                                              max =         85

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(5)      =      16.68
Log pseudolikelihood  = -731.11808              Prob > chi2       =     0.0051

                                                       (Std. Err. adjusted for 144 clusters in cowcode)
-------------------------------------------------------------------------------------------------------
                                      |               Robust
                                revny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------------------------+----------------------------------------------------------------
                     lnyrsindependent |   .4225426   .1193851    -3.05   0.002      .242869     .735138
                                      |
c.lnyrsindependent#c.lnyrsindependent |   1.129337   .0543924     2.53   0.012     1.027607    1.241138
                                      |
                                time1 |   1.034973    .036174     0.98   0.325      .966447    1.108357
                               timesq |   .9987744   .0009795    -1.25   0.211     .9968565    1.000696
                              timecub |    1.00001   7.49e-06     1.29   0.198      .999995    1.000024
                                _cons |   .0605324   .0294502    -5.76   0.000     .0233271    .1570777
--------------------------------------+----------------------------------------------------------------
                             /lnsig2u |  -.3843123   .3254544                     -1.022191    .2535665
--------------------------------------+----------------------------------------------------------------
                              sigma_u |    .825178   .1342789                       .599838    1.135171
                                  rho |   .2927609    .067386                      .1794775    .4392679
-------------------------------------------------------------------------------------------------------

. margins, atmeans at(lnyrsindependent=(0 .69314718 1.0986123 1.3862944 1.6094379 1.7917595 1.9459101 2.0794415 2.
> 1972246 2.3025851))

Adjusted predictions                            Number of obs     =      7,367
Model VCE    : Robust

Expression   : Linear prediction, predict()

1._at        : lnyrsindep~t    =           0
               time1           =    51.48405 (mean)
               timesq          =    3230.779 (mean)
               timecub         =    219910.8 (mean)

2._at        : lnyrsindep~t    =    .6931472
               time1           =    51.48405 (mean)
               timesq          =    3230.779 (mean)
               timecub         =    219910.8 (mean)

3._at        : lnyrsindep~t    =    1.098612
               time1           =    51.48405 (mean)
               timesq          =    3230.779 (mean)
               timecub         =    219910.8 (mean)

4._at        : lnyrsindep~t    =    1.386294
               time1           =    51.48405 (mean)
               timesq          =    3230.779 (mean)
               timecub         =    219910.8 (mean)

5._at        : lnyrsindep~t    =    1.609438
               time1           =    51.48405 (mean)
               timesq          =    3230.779 (mean)
               timecub         =    219910.8 (mean)

6._at        : lnyrsindep~t    =    1.791759
               time1           =    51.48405 (mean)
               timesq          =    3230.779 (mean)
               timecub         =    219910.8 (mean)

7._at        : lnyrsindep~t    =     1.94591
               time1           =    51.48405 (mean)
               timesq          =    3230.779 (mean)
               timecub         =    219910.8 (mean)

8._at        : lnyrsindep~t    =    2.079442
               time1           =    51.48405 (mean)
               timesq          =    3230.779 (mean)
               timecub         =    219910.8 (mean)

9._at        : lnyrsindep~t    =    2.197225
               time1           =    51.48405 (mean)
               timesq          =    3230.779 (mean)
               timecub         =    219910.8 (mean)

10._at       : lnyrsindep~t    =    2.302585
               time1           =    51.48405 (mean)
               timesq          =    3230.779 (mean)
               timecub         =    219910.8 (mean)

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   -2.87523   .3879105    -7.41   0.000    -3.635521    -2.11494
          2  |  -3.413914   .2657142   -12.85   0.000    -3.934705   -2.893124
          3  |  -3.674844   .2283521   -16.09   0.000    -4.122406   -3.227282
          4  |  -3.835723    .215478   -17.80   0.000    -4.258052   -3.413393
          5  |  -3.946645   .2112311   -18.68   0.000    -4.360651    -3.53264
          6  |  -4.028284    .210196   -19.16   0.000    -4.440261   -3.616308
          7  |     -4.091   .2103153   -19.45   0.000    -4.503211    -3.67879
          8  |  -4.140655   .2107608   -19.65   0.000    -4.553739   -3.727571
          9  |  -4.180853   .2111933   -19.80   0.000    -4.594784   -3.766922
         10  |  -4.213952   .2114794   -19.93   0.000    -4.628444    -3.79946
------------------------------------------------------------------------------

. xtcloglog revny c.lnyrsindependent##c.lnyrsindependent time1 timesq timecub if year>1984, vce(robust) nolog efor
> m

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      4,601
Group variable: cowcode                         Number of groups  =        157

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          7
                                                              avg =       29.3
                                                              max =         30

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(5)      =      15.01
Log pseudolikelihood  = -527.41952              Prob > chi2       =     0.0103

                                                       (Std. Err. adjusted for 157 clusters in cowcode)
-------------------------------------------------------------------------------------------------------
                                      |               Robust
                                revny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------------------------+----------------------------------------------------------------
                     lnyrsindependent |   3.623253   4.375223     1.07   0.286     .3398122      38.633
                                      |
c.lnyrsindependent#c.lnyrsindependent |   .8498928   .1293219    -1.07   0.285     .6307294     1.14521
                                      |
                                time1 |   1773.438   8368.342     1.59   0.113     .1707035    1.84e+07
                               timesq |   .9244101    .043582    -1.67   0.095     .8428186      1.0139
                              timecub |   1.000273   .0001563     1.75   0.081     .9999667    1.000579
                                _cons |   1.0e-105   1.6e-103    -1.54   0.123     3.6e-239    2.88e+28
--------------------------------------+----------------------------------------------------------------
                             /lnsig2u |  -.4095778   .3364524                     -1.069012    .2498568
--------------------------------------+----------------------------------------------------------------
                              sigma_u |   .8148193    .137074                      .5859585    1.133067
                                  rho |   .2875571   .0689283                      .1726855    .4383543
-------------------------------------------------------------------------------------------------------

. xtcloglog revny lnyrsindependent time1 timesq timecub if year>1984, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      4,601
Group variable: cowcode                         Number of groups  =        157

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          7
                                                              avg =       29.3
                                                              max =         30

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      15.12
Log pseudolikelihood  = -528.72297              Prob > chi2       =     0.0045

                                  (Std. Err. adjusted for 157 clusters in cowcode)
----------------------------------------------------------------------------------
                 |               Robust
           revny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
lnyrsindependent |   1.034168   .1320571     0.26   0.792     .8051892    1.328265
           time1 |   1019.072   4825.884     1.46   0.144     .0949036    1.09e+07
          timesq |   .9294704   .0439613    -1.55   0.122     .8471809    1.019753
         timecub |   1.000255   .0001567     1.63   0.103     .9999481    1.000562
           _cons |   1.21e-96   1.90e-94    -1.40   0.160     1.4e-230    1.02e+38
-----------------+----------------------------------------------------------------
        /lnsig2u |  -.4404558   .3262906                     -1.079974     .199062
-----------------+----------------------------------------------------------------
         sigma_u |   .8023359   .1308973                      .5827559    1.104653
             rho |   .2812729   .0659624                      .1711252    .4258904
----------------------------------------------------------------------------------

. xtcloglog ruralrevny lnyrsindependent time1 timesq timecub, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     11,968
Group variable: cowcode                         Number of groups  =        158

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         10
                                                              avg =       75.7
                                                              max =        115

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      15.42
Log pseudolikelihood  = -641.09773              Prob > chi2       =     0.0039

                                  (Std. Err. adjusted for 158 clusters in cowcode)
----------------------------------------------------------------------------------
                 |               Robust
      ruralrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
lnyrsindependent |   .7185092   .0742148    -3.20   0.001     .5868293    .8797372
           time1 |   .9884032   .0294625    -0.39   0.696     .9323122    1.047869
          timesq |   1.000026   .0006087     0.04   0.966     .9988334    1.001219
         timecub |          1   3.54e-06     0.12   0.906     .9999935    1.000007
           _cons |   .0272794   .0135632    -7.24   0.000     .0102948    .0722853
-----------------+----------------------------------------------------------------
        /lnsig2u |   .3739908   .2425641                      -.101426    .8494076
-----------------+----------------------------------------------------------------
         sigma_u |   1.205622   .1462203                      .9505514    1.529137
             rho |    .469112   .0604096                      .3545436    .5870315
----------------------------------------------------------------------------------

. xtcloglog urbanrevny lnyrsindependent time1 timesq timecub, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     11,968
Group variable: cowcode                         Number of groups  =        158

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         10
                                                              avg =       75.7
                                                              max =        115

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      11.93
Log pseudolikelihood  = -793.73485              Prob > chi2       =     0.0179

                                  (Std. Err. adjusted for 158 clusters in cowcode)
----------------------------------------------------------------------------------
                 |               Robust
      urbanrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
lnyrsindependent |   1.160004   .1312918     1.31   0.190     .9292206    1.448106
           time1 |   1.004007   .0244384     0.16   0.869     .9572336    1.053067
          timesq |   .9996922   .0004812    -0.64   0.522     .9987496    1.000636
         timecub |   1.000003   2.67e-06     1.00   0.316     .9999974    1.000008
           _cons |   .0060795   .0036393    -8.52   0.000     .0018807    .0196525
-----------------+----------------------------------------------------------------
        /lnsig2u |  -.8459687   .3454424                     -1.523023   -.1689141
-----------------+----------------------------------------------------------------
         sigma_u |   .6550889   .1131477                        .46696    .9190111
             rho |   .2069073    .056686                      .1170442    .3392554
----------------------------------------------------------------------------------

. 
. * ================================
. * NUMBER OF STATES AND REVOLUTION
. * ================================
. use "statesandepisodes.dta", clear

. arpois newrevs1000 statesl , ar(2) delete 
log-linear autoregressive model 2 order

(sum of wgt is 336.26941)

Iteration 0:   residual SS =  54.59626
Iteration 1:   residual SS =  41.57565

      Source |       SS       df       MS            Number of obs =       112
-------------+------------------------------         F(  3,   108) =     14.14
       Model |   16.331301     3  5.44376698         Prob > F      =    0.0000
    Residual |  41.5756543   108  .384959762         R-squared     =    0.2820
-------------+------------------------------         Adj R-squared =    0.2621
       Total |  57.9069553   111  .521684282         Root MSE      =  .6204513
                                                     Res. dev.     =  208.6777
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |   .7686286   .1394149     5.51   0.000     .4922841    1.044973
          X1 |   .0029569   .0010509     2.81   0.006     .0008739    .0050399
          R1 |    .329096   .0923278     3.56   0.001     .1460863    .5121057
          R2 |   .2384531    .091974     2.59   0.011     .0561446    .4207615
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. * compute IRR
. matrix b = e(b)

. scalar X1= b[1,2]

. display exp(X1)
1.0029612

. scalar drop _all

. * Estimated effect on number of revs by early 21st century
. predict xb
(option yhat assumed; fitted values)
(3 missing values generated)

. generate exp_xb = exp(xb)
(3 missing values generated)

. summarize exp_xb if year>1899 & year<1920

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      exp_xb |         17    2.612382    1.586663   1.392612   8.115829

. summarize exp_xb if year>1999 & year<2015

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      exp_xb |         15    3.764409     .888921   2.830536   6.117063

. drop xb exp_xb

. 
. * ==================================
. * WORLD URBANIZATION AND REVOLUTION
. * ==================================
. arpois newrevs1000 estworldurbanl , ar(2) delete
log-linear autoregressive model 2 order

(sum of wgt is 336.74706)

Iteration 0:   residual SS =   53.9884
Iteration 1:   residual SS =  40.79137

      Source |       SS       df       MS            Number of obs =       112
-------------+------------------------------         F(  3,   108) =     14.87
       Model |  16.8442184     3  5.61473945         Prob > F      =    0.0000
    Residual |  40.7913654   108  .377697828         R-squared     =    0.2923
-------------+------------------------------         Adj R-squared =    0.2726
       Total |  57.6355838   111  .519239493         Root MSE      =  .6145713
                                                     Res. dev.     =  206.7853
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |   .5628741   .1892855     2.97   0.004     .1876774    .9380708
          X1 |   .0165562   .0052801     3.14   0.002       .00609    .0270224
          R1 |   .3392768   .0924684     3.67   0.000     .1559884    .5225653
          R2 |   .2338992   .0922392     2.54   0.013      .051065    .4167334
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. * compute IRR
. matrix b = e(b)

. scalar X1= b[1,2]

. display exp(X1)
1.016694

. scalar drop _all

. * Estimated effect on number of revs by early 21st century
. predict xb
(option yhat assumed; fitted values)
(3 missing values generated)

. generate exp_xb = exp(xb)
(3 missing values generated)

. summarize exp_xb if year>1899 & year<1920

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      exp_xb |         17    2.554301    1.658224   1.314955   8.286782

. summarize exp_xb if year>1999 & year<2015

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      exp_xb |         15    3.856192    .9280762   2.868308    6.29099

. drop xb exp_xb

. 
. * =======================================================================
. * GROWING HAZARD OF REVOLUTIONARY EPISODES ACROSS FIXED TERRITORIAL UNITS
. * =======================================================================
. clear

. use revspellsbase.dta

. * Monthly results temporarily stored in hazard.dta
. sts graph, hazard width(12) outfile(hazard, replace)

         failure _d:  status
   analysis time _t:  (monthyfail-origin)
             origin:  time monthyr0
  exit on or before:  monthyfail==659
                 id:  cowcode

. clear

. use hazard.dta

. generate yrhazard = 12 * Vhazard

. twoway (lfitci yrhazard _t) (line yrhazard _t)

. * Saving graph to hard drive as figure2.4.pdf
. graph export Logfiles\figure2_4.pdf, replace
(file Logfiles\figure2_4.pdf written in PDF format)

. * Closing graph editor
. graph drop _all

. erase hazard.dta

. 
. * ========================================================================
. * ROLE OF URBAN AND URBAN CIVIC REVS IN GROWTH OF REV EPISODES, FIGURE 2.7
. * ========================================================================
. clear

. use statesandepisodes.dta

. arpois newrevs1000 year, delete
log-linear autoregressive model 0 order

(sum of wgt is 343)

Iteration 0:   residual SS =  55.38829

      Source |       SS       df       MS            Number of obs =       115
-------------+------------------------------         F(  1,   113) =      8.77
       Model |  4.29941818     1  4.29941818         Prob > F      =    0.0037
    Residual |  55.3882852   113  .490161816         R-squared     =    0.0720
-------------+------------------------------         Adj R-squared =    0.0638
       Total |  59.6877033   114  .523576345         Root MSE      =  .7001156
                                                     Res. dev.     =  244.5319
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |  -10.45565   3.906247    -2.68   0.009    -18.19463   -2.716672
          X1 |   .0058914   .0019892     2.96   0.004     .0019504    .0098323
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. arpois urbanrevs year, delete
log-linear autoregressive model 0 order

(sum of wgt is 180)

Iteration 0:   residual SS =  114.2856

      Source |       SS       df       MS            Number of obs =       115
-------------+------------------------------         F(  1,   113) =     13.25
       Model |  13.4006605     1  13.4006605         Prob > F      =    0.0004
    Residual |  114.285559   113  1.01137663         R-squared     =    0.1049
-------------+------------------------------         Adj R-squared =    0.0970
       Total |  127.686219   114  1.12005455         Root MSE      =  1.005672
                                                     Res. dev.     =  332.7632
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |  -20.49277   5.770265    -3.55   0.001    -31.92471   -9.060838
          X1 |   .0106688    .002931     3.64   0.000     .0048621    .0164756
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. arpois ruralrevs year, delete
log-linear autoregressive model 0 order

(sum of wgt is 163)

Iteration 0:   residual SS =  77.28251

      Source |       SS       df       MS            Number of obs =       115
-------------+------------------------------         F(  1,   113) =      0.12
       Model |  .082568564     1  .082568564         Prob > F      =    0.7289
    Residual |  77.2825099   113  .683916017         R-squared     =    0.0011
-------------+------------------------------         Adj R-squared =   -0.0078
       Total |  77.3650785   114  .678641039         Root MSE      =  .8269922
                                                     Res. dev.     =  280.6887
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |  -1.231523   4.549942    -0.27   0.787    -10.24578    7.782733
          X1 |   .0008073   .0023236     0.35   0.729    -.0037961    .0054108
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. arpois noleft year, delete
log-linear autoregressive model 0 order

(sum of wgt is 263)

Iteration 0:   residual SS =  81.78408

      Source |       SS       df       MS            Number of obs =       115
-------------+------------------------------         F(  1,   113) =     12.33
       Model |  8.92605646     1  8.92605646         Prob > F      =    0.0006
    Residual |   81.784082   113  .723752938         R-squared     =    0.0984
-------------+------------------------------         Adj R-squared =    0.0904
       Total |  90.7101384   114  .795702969         Root MSE      =  .8507367
                                                     Res. dev.     =   291.804
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |  -16.03777   4.814298    -3.33   0.001    -25.57576   -6.499776
          X1 |   .0085971    .002448     3.51   0.001     .0037471    .0134471
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. arpois leftist year, delete
log-linear autoregressive model 0 order

(sum of wgt is 80)

Iteration 0:   residual SS =  246.6768

      Source |       SS       df       MS            Number of obs =       115
-------------+------------------------------         F(  1,   113) =      0.44
       Model |  .953332117     1  .953332117         Prob > F      =    0.5101
    Residual |  246.676803   113  2.18298056         R-squared     =    0.0038
-------------+------------------------------         Adj R-squared =   -0.0050
       Total |  247.630136   114  2.17219417         Root MSE      =  1.477491
                                                     Res. dev.     =  414.5964
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |   5.013861   8.131125     0.62   0.539    -11.09536    21.12309
          X1 |  -.0027496   .0041607    -0.66   0.510    -.0109927    .0054936
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. arpois nociv year, delete
log-linear autoregressive model 0 order

(sum of wgt is 288)

Iteration 0:   residual SS =  54.84176

      Source |       SS       df       MS            Number of obs =       115
-------------+------------------------------         F(  1,   113) =      0.05
       Model |  .024658623     1  .024658623         Prob > F      =    0.8221
    Residual |  54.8417607   113  .485325316         R-squared     =    0.0004
-------------+------------------------------         Adj R-squared =   -0.0084
       Total |  54.8664193   114   .48128438         Root MSE      =  .6966529
                                                     Res. dev.     =   241.213
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |   .0546177   3.831473     0.01   0.989    -7.536222    7.645458
          X1 |   .0004411   .0019571     0.23   0.822    -.0034362    .0043184
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. arpois urbanciv year, delete
log-linear autoregressive model 0 order

(sum of wgt is 54.999999)

Iteration 0:   residual SS =  333.8197

      Source |       SS       df       MS            Number of obs =       115
-------------+------------------------------         F(  1,   113) =     34.60
       Model |  102.206524     1  102.206524         Prob > F      =    0.0000
    Residual |   333.81966   113  2.95415629         R-squared     =    0.2344
-------------+------------------------------         Adj R-squared =    0.2276
       Total |  436.026184   114  3.82479109         Root MSE      =  1.718766
                                                     Res. dev.     =   575.271
(aphea)
------------------------------------------------------------------------------
          _z |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X0 |   -98.4579   16.74341    -5.88   0.000    -131.6296   -65.28618
          X1 |   .0493722   .0083938     5.88   0.000     .0327426    .0660019
------------------------------------------------------------------------------
* Parameter X0 taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. 
. * =====================================================
. * LAND CONCENTRATION IN SOCIAL REVOLUTIONS--FIGURE 2.8
. * =====================================================
. clear

. use revspredictbycntryyr.dta

. xtcloglog leftistny landgini c.time1##c.time1##c.time1, vce(robust) eform nolog

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      6,634
Group variable: cowcode                         Number of groups  =        136

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          6
                                                              avg =       48.8
                                                              max =        113

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      40.24
Log pseudolikelihood  = -297.37087              Prob > chi2       =     0.0000

                                         (Std. Err. adjusted for 136 clusters in cowcode)
-----------------------------------------------------------------------------------------
                        |               Robust
              leftistny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
               landgini |   1.024279   .0092834     2.65   0.008     1.006245    1.042637
                  time1 |   .8319341   .0392147    -3.90   0.000     .7585183    .9124557
                        |
        c.time1#c.time1 |    1.00421   .0011778     3.58   0.000     1.001904    1.006521
                        |
c.time1#c.time1#c.time1 |   .9999722   7.73e-06    -3.60   0.000      .999957    .9999873
                        |
                  _cons |   .0137406   .0114856    -5.13   0.000     .0026699    .0707157
------------------------+----------------------------------------------------------------
               /lnsig2u |  -.6667943   .5993686                     -1.841535    .5079465
------------------------+----------------------------------------------------------------
                sigma_u |   .7164856   .2147195                      .3982133    1.289137
                    rho |   .2378516   .1086524                      .0879252    .5025615
-----------------------------------------------------------------------------------------

. margins, atmeans at(landgini=(0 10 20 30 40 50 60 70 80 90 100))

Adjusted predictions                            Number of obs     =      6,634
Model VCE    : Robust

Expression   : Linear prediction, predict()

1._at        : landgini        =           0
               time1           =    70.81399 (mean)

2._at        : landgini        =          10
               time1           =    70.81399 (mean)

3._at        : landgini        =          20
               time1           =    70.81399 (mean)

4._at        : landgini        =          30
               time1           =    70.81399 (mean)

5._at        : landgini        =          40
               time1           =    70.81399 (mean)

6._at        : landgini        =          50
               time1           =    70.81399 (mean)

7._at        : landgini        =          60
               time1           =    70.81399 (mean)

8._at        : landgini        =          70
               time1           =    70.81399 (mean)

9._at        : landgini        =          80
               time1           =    70.81399 (mean)

10._at       : landgini        =          90
               time1           =    70.81399 (mean)

11._at       : landgini        =         100
               time1           =    70.81399 (mean)

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |  -6.125955   .6823695    -8.98   0.000    -7.463375   -4.788535
          2  |  -5.886064   .5986108    -9.83   0.000     -7.05932   -4.712809
          3  |  -5.646174   .5171754   -10.92   0.000    -6.659819   -4.632529
          4  |  -5.406283    .439357   -12.30   0.000    -6.267407   -4.545159
          5  |  -5.166393   .3674609   -14.06   0.000    -5.886603   -4.446183
          6  |  -4.926502   .3056946   -16.12   0.000    -5.525652   -4.327352
          7  |  -4.686612   .2613417   -17.93   0.000    -5.198832   -4.174391
          8  |  -4.446721   .2440872   -18.22   0.000    -4.925123   -3.968319
          9  |   -4.20683   .2593961   -16.22   0.000    -4.715237   -3.698424
         10  |   -3.96694    .302362   -13.12   0.000    -4.559559   -3.374321
         11  |  -3.727049   .3633015   -10.26   0.000    -4.439107   -3.014992
------------------------------------------------------------------------------

. * Versus urban, rural, and urban civic revolutions
. xtcloglog ruralrevny landgini c.time1##c.time1##c.time1, vce(robust) eform nolog

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      6,634
Group variable: cowcode                         Number of groups  =        136

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          6
                                                              avg =       48.8
                                                              max =        113

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      16.14
Log pseudolikelihood  = -331.98538              Prob > chi2       =     0.0028

                                         (Std. Err. adjusted for 136 clusters in cowcode)
-----------------------------------------------------------------------------------------
                        |               Robust
             ruralrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
               landgini |   1.000618   .0098303     0.06   0.950      .981535    1.020072
                  time1 |   .8516633   .0538208    -2.54   0.011     .7524477    .9639612
                        |
        c.time1#c.time1 |   1.003367     .00119     2.83   0.005     1.001037    1.005702
                        |
c.time1#c.time1#c.time1 |   .9999796   6.85e-06    -2.98   0.003     .9999662     .999993
                        |
                  _cons |   .0385846   .0472417    -2.66   0.008     .0035013    .4252037
------------------------+----------------------------------------------------------------
               /lnsig2u |   .3628224   .3394869                     -.3025597    1.028204
------------------------+----------------------------------------------------------------
                sigma_u |   1.198908   .2035068                      .8596071    1.672137
                    rho |   .4663316   .0844869                      .3099699    .6296007
-----------------------------------------------------------------------------------------

. xtcloglog urbanrevny landgini c.time1##c.time1##c.time1, vce(robust) eform nolog

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      6,634
Group variable: cowcode                         Number of groups  =        136

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          6
                                                              avg =       48.8
                                                              max =        113

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =       7.57
Log pseudolikelihood  = -402.29342              Prob > chi2       =     0.1086

                                         (Std. Err. adjusted for 136 clusters in cowcode)
-----------------------------------------------------------------------------------------
                        |               Robust
             urbanrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
               landgini |   1.009869   .0107501     0.92   0.356     .9890176     1.03116
                  time1 |   .9183099   .0418747    -1.87   0.062     .8397978    1.004162
                        |
        c.time1#c.time1 |   1.001392   .0009214     1.51   0.131     .9995872    1.003199
                        |
c.time1#c.time1#c.time1 |   .9999928   5.33e-06    -1.35   0.177     .9999824    1.000003
                        |
                  _cons |   .0263944   .0282959    -3.39   0.001     .0032284    .2157923
------------------------+----------------------------------------------------------------
               /lnsig2u |  -.9410171   .6191312                     -2.154492    .2724577
------------------------+----------------------------------------------------------------
                sigma_u |   .6246845   .1933808                      .3405321    1.145944
                    rho |    .191744   .0959519                       .065854    .4439262
-----------------------------------------------------------------------------------------

. xtcloglog urbancivicny landgini c.time1##c.time1##c.time1, vce(robust) eform nolog

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      6,634
Group variable: cowcode                         Number of groups  =        136

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          6
                                                              avg =       48.8
                                                              max =        113

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      16.20
Log pseudolikelihood  =  -138.2233              Prob > chi2       =     0.0028

                                         (Std. Err. adjusted for 136 clusters in cowcode)
-----------------------------------------------------------------------------------------
                        |               Robust
           urbancivicny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
               landgini |   .9676593    .015354    -2.07   0.038     .9380291    .9982254
                  time1 |   .7963398   .0794787    -2.28   0.023     .6548536    .9683951
                        |
        c.time1#c.time1 |   1.004106   .0018531     2.22   0.026     1.000481    1.007745
                        |
c.time1#c.time1#c.time1 |   .9999803     .00001    -1.97   0.049     .9999606    .9999999
                        |
                  _cons |   .1615449   .3298948    -0.89   0.372     .0029514    8.842037
------------------------+----------------------------------------------------------------
               /lnsig2u |  -.4767304   .6654802                     -1.781048    .8275869
------------------------+----------------------------------------------------------------
                sigma_u |   .7879149   .2621709                      .4104407    1.512545
                    rho |   .2739983   .1323795                      .0928984    .5817318
-----------------------------------------------------------------------------------------

. 
. * ===================================================================
. * RAPID POPULATION GROWTH AND YOUTH BULGES IN REVOLUTIONARY EPISODES
. * ===================================================================
. * Before and after end of Cold War--adults aged 15-24
. xtcloglog revny  i.postcoldwar##c.youthpercl time1 timesq timecub, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     10,158
Group variable: cowcode                         Number of groups  =        160

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         23
                                                              avg =       63.5
                                                              max =         64

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(6)      =      31.99
Log pseudolikelihood  = -1002.0783              Prob > chi2       =     0.0000

                                          (Std. Err. adjusted for 160 clusters in cowcode)
------------------------------------------------------------------------------------------
                         |               Robust
                   revny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------------+----------------------------------------------------------------
           1.postcoldwar |   26.00467   24.96717     3.39   0.001     3.961047    170.7233
              youthpercl |     1.0863   .0239722     3.75   0.000     1.040317    1.134316
                         |
postcoldwar#c.youthpercl |
                      1  |   .9411777   .0255423    -2.23   0.025     .8924239    .9925949
                         |
                   time1 |   4.006113   1.335309     4.16   0.000     2.084503    7.699169
                  timesq |   .9828127   .0040581    -4.20   0.000     .9748911    .9907987
                 timecub |   1.000069   .0000164     4.20   0.000     1.000037    1.000101
                   _cons |   3.90e-19   3.45e-18    -4.80   0.000     1.17e-26    1.30e-11
-------------------------+----------------------------------------------------------------
                /lnsig2u |  -.8621403   .3037035                     -1.457388   -.2668924
-------------------------+----------------------------------------------------------------
                 sigma_u |   .6498133   .0986753                      .4825387    .8750746
                     rho |   .2042662   .0493644                      .1239996      .31765
------------------------------------------------------------------------------------------

. *  Aged 15-24, controlling for population size, level of development, and economic growth
. xtcloglog revny lnpopl gdppcthl gdppcgrow1yrl i.postcoldwar##c.youthpercl time1 timesq timecub, vce(robust) nolo
> g eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      9,697
Group variable: cowcode                         Number of groups  =        160

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         22
                                                              avg =       60.6
                                                              max =         64

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(9)      =     107.12
Log pseudolikelihood  = -959.90247              Prob > chi2       =     0.0000

                                          (Std. Err. adjusted for 160 clusters in cowcode)
------------------------------------------------------------------------------------------
                         |               Robust
                   revny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------------+----------------------------------------------------------------
                  lnpopl |   1.335808   .0570155     6.78   0.000     1.228606    1.452363
                gdppcthl |   .8749771   .0258218    -4.53   0.000     .8258031    .9270792
           gdppcgrow1yrl |   .9856823   .0092206    -1.54   0.123      .967775    1.003921
           1.postcoldwar |   57.10356   59.08916     3.91   0.000     7.513871    433.9729
              youthpercl |   1.046084   .0266998     1.77   0.078     .9950407    1.099746
                         |
postcoldwar#c.youthpercl |
                      1  |   .9162825   .0265834    -3.01   0.003     .8656336    .9698948
                         |
                   time1 |   4.147817   1.389246     4.25   0.000     2.151409    7.996799
                  timesq |   .9824341   .0040508    -4.30   0.000     .9745266    .9904057
                 timecub |    1.00007   .0000163     4.31   0.000     1.000038    1.000102
                   _cons |   6.74e-20   5.99e-19    -4.97   0.000     1.83e-27    2.48e-12
-------------------------+----------------------------------------------------------------
                /lnsig2u |  -2.668915   1.069756                     -4.765599   -.5722313
-------------------------+----------------------------------------------------------------
                 sigma_u |    .263301   .1408339                      .0922918    .7511757
                     rho |   .0404416    .041513                      .0051515    .2554161
------------------------------------------------------------------------------------------

. *  Youth bulges, as measured by populaton aged 0-15
. xtcloglog revny i.postcoldwar##c.percunder15l time1 timesq timecub, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      9,717
Group variable: cowcode                         Number of groups  =        161

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         19
                                                              avg =       60.4
                                                              max =         61

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(6)      =      19.27
Log pseudolikelihood  = -951.59337              Prob > chi2       =     0.0037

                                            (Std. Err. adjusted for 161 clusters in cowcode)
--------------------------------------------------------------------------------------------
                           |               Robust
                     revny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
---------------------------+----------------------------------------------------------------
             1.postcoldwar |   6.016896   3.420297     3.16   0.002     1.974731    18.33315
              percunder15l |   1.015498   .0114184     1.37   0.171     .9933637    1.038126
                           |
postcoldwar#c.percunder15l |
                        1  |   .9888268   .0106249    -1.05   0.296     .9682201    1.009872
                           |
                     time1 |   4.741684   2.083615     3.54   0.000      2.00398    11.21946
                    timesq |   .9807884   .0053995    -3.52   0.000     .9702626    .9914285
                   timecub |   1.000077   .0000222     3.48   0.001     1.000034    1.000121
                     _cons |   2.78e-20   3.16e-19    -3.95   0.000     5.65e-30    1.37e-10
---------------------------+----------------------------------------------------------------
                  /lnsig2u |  -.7399333   .3001174                     -1.328153    -.151714
---------------------------+----------------------------------------------------------------
                   sigma_u |   .6907574   .1036542                      .5147488    .9269487
                       rho |   .2248482   .0523079                       .138733    .3431215
--------------------------------------------------------------------------------------------

. *  Aged 0-15, controlling for population size, level of development, and economic growth
. xtcloglog revny lnpopl gdppcthl gdppcgrow1yrl i.postcoldwar##c.percunder15l time1 timesq timecub, vce(robust) no
> log eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      9,258
Group variable: cowcode                         Number of groups  =        161

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         19
                                                              avg =       57.5
                                                              max =         61

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(9)      =      98.61
Log pseudolikelihood  = -910.10653              Prob > chi2       =     0.0000

                                            (Std. Err. adjusted for 161 clusters in cowcode)
--------------------------------------------------------------------------------------------
                           |               Robust
                     revny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
---------------------------+----------------------------------------------------------------
                    lnpopl |   1.322972   .0606087     6.11   0.000     1.209358    1.447259
                  gdppcthl |   .8823885   .0225504    -4.90   0.000     .8392792    .9277121
             gdppcgrow1yrl |   .9846503   .0106758    -1.43   0.154     .9639469    1.005798
             1.postcoldwar |   18.46467   14.18956     3.79   0.000     4.094663    83.26548
              percunder15l |   1.012962   .0095412     1.37   0.172     .9944332    1.031836
                           |
postcoldwar#c.percunder15l |
                        1  |     .96118   .0156036    -2.44   0.015     .9310789    .9922542
                           |
                     time1 |   5.385673   2.374694     3.82   0.000     2.269454    12.78082
                    timesq |   .9792211   .0053862    -3.82   0.000     .9687211     .989835
                   timecub |   1.000084   .0000221     3.78   0.000      1.00004    1.000127
                     _cons |   2.01e-22   2.30e-21    -4.36   0.000     3.49e-32    1.15e-12
---------------------------+----------------------------------------------------------------
                  /lnsig2u |  -2.631574   1.102252                     -4.791948   -.4712008
---------------------------+----------------------------------------------------------------
                   sigma_u |   .2682631   .1478467                      .0910839    .7900963
                       rho |   .0419157   .0442651                      .0050182    .2750996
--------------------------------------------------------------------------------------------

. * Rural vs. urban revs
. xtcloglog ruralrevny lnpopl youthpercl time1 timesq timecub, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     10,158
Group variable: cowcode                         Number of groups  =        160

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         23
                                                              avg =       63.5
                                                              max =         64

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(5)      =      60.43
Log pseudolikelihood  = -503.01771              Prob > chi2       =     0.0000

                              (Std. Err. adjusted for 160 clusters in cowcode)
------------------------------------------------------------------------------
             |               Robust
  ruralrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      lnpopl |   1.506057   .1081311     5.70   0.000     1.308361    1.733627
  youthpercl |   1.138634   .0323397     4.57   0.000     1.076982    1.203816
       time1 |   2.367812   1.053431     1.94   0.053     .9900355    5.662963
      timesq |   .9892069   .0055371    -1.94   0.053     .9784137    1.000119
     timecub |   1.000044   .0000228     1.91   0.057     .9999988    1.000088
       _cons |   1.30e-15   1.53e-14    -2.91   0.004     1.27e-25    .0000134
-------------+----------------------------------------------------------------
    /lnsig2u |  -1.672339   .7164332                     -3.076522    -.268156
-------------+----------------------------------------------------------------
     sigma_u |   .4333673   .1552394                      .2147542    .8745218
         rho |   .1024734   .0658922                      .0272726    .3173761
------------------------------------------------------------------------------

. xtcloglog urbanrevny lnpopl youthpercl time1 timesq timecub, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     10,158
Group variable: cowcode                         Number of groups  =        160

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         23
                                                              avg =       63.5
                                                              max =         64

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(5)      =      20.99
Log pseudolikelihood  =  -615.1768              Prob > chi2       =     0.0008

                              (Std. Err. adjusted for 160 clusters in cowcode)
------------------------------------------------------------------------------
             |               Robust
  urbanrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      lnpopl |   1.233117   .0962903     2.68   0.007     1.058124     1.43705
  youthpercl |   1.001744   .0150869     0.12   0.908     .9726067    1.031755
       time1 |   1.205096   .4194008     0.54   0.592     .6092341    2.383741
      timesq |   .9978153   .0042148    -0.52   0.605     .9895886     1.00611
     timecub |   1.000009   .0000167     0.54   0.592     .9999762    1.000042
       _cons |   4.59e-06   .0000431    -1.31   0.191     4.66e-14     452.769
-------------+----------------------------------------------------------------
    /lnsig2u |   -.672866   .3569806                     -1.372535    .0268031
-------------+----------------------------------------------------------------
     sigma_u |   .7143138   .1274981                      .5034517    1.013492
         rho |   .2367526   .0645067                      .1335145    .3844039
------------------------------------------------------------------------------

. * Interaction between economic growth and youth bulges
. xtcloglog revny lnpopl gdppcthl c.gdppcgrow1yrl##c.youthpercl time1 timesq timecub, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      9,697
Group variable: cowcode                         Number of groups  =        160

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         22
                                                              avg =       60.6
                                                              max =         64

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(8)      =      84.32
Log pseudolikelihood  = -969.51175              Prob > chi2       =     0.0000

                                              (Std. Err. adjusted for 160 clusters in cowcode)
----------------------------------------------------------------------------------------------
                             |               Robust
                       revny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------------------+----------------------------------------------------------------
                      lnpopl |   1.318315   .0576235     6.32   0.000     1.210078    1.436234
                    gdppcthl |   .8772228   .0275658    -4.17   0.000      .824825    .9329492
               gdppcgrow1yrl |   .9799098   .0534303    -0.37   0.710     .8805899    1.090432
                  youthpercl |   .9788852   .0189948    -1.10   0.271     .9423552    1.016831
                             |
c.gdppcgrow1yrl#c.youthpercl |     1.0001   .0017274     0.06   0.954     .9967199    1.003491
                             |
                       time1 |   1.819258    .495471     2.20   0.028     1.066772    3.102539
                      timesq |   .9928139   .0033152    -2.16   0.031     .9863374    .9993329
                     timecub |   1.000028   .0000133     2.13   0.033     1.000002    1.000055
                       _cons |   4.64e-10   3.41e-09    -2.92   0.003     2.58e-16    .0008344
-----------------------------+----------------------------------------------------------------
                    /lnsig2u |  -2.570144   1.043424                     -4.615217   -.5250703
-----------------------------+----------------------------------------------------------------
                     sigma_u |   .2766307   .1443216                      .0994989    .7690993
                         rho |   .0444533   .0443217                      .0059825    .2644881
----------------------------------------------------------------------------------------------

. xtcloglog revny lnpopl gdppcthl c.gdppcgrow1yrl##c.percunder15l time1 timesq timecub, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      9,258
Group variable: cowcode                         Number of groups  =        161

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         19
                                                              avg =       57.5
                                                              max =         61

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(8)      =      80.26
Log pseudolikelihood  = -918.05829              Prob > chi2       =     0.0000

                                                (Std. Err. adjusted for 161 clusters in cowcode)
------------------------------------------------------------------------------------------------
                               |               Robust
                         revny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------------------+----------------------------------------------------------------
                        lnpopl |   1.312433   .0611476     5.84   0.000     1.197895    1.437923
                      gdppcthl |   .8905798   .0234267    -4.41   0.000     .8458278    .9376996
                 gdppcgrow1yrl |   1.059924   .0592647     1.04   0.298     .9499059    1.182685
                  percunder15l |   .9947617   .0112205    -0.47   0.641     .9730112    1.016998
                               |
c.gdppcgrow1yrl#c.percunder15l |   .9980909    .001344    -1.42   0.156     .9954602    1.000729
                               |
                         time1 |   2.021396   .7001999     2.03   0.042      1.02518    3.985682
                        timesq |   .9914444   .0043047    -1.98   0.048     .9830431    .9999175
                       timecub |   1.000034   .0000178     1.93   0.053     .9999995    1.000069
                         _cons |   2.22e-11   2.02e-10    -2.70   0.007     3.96e-19    .0012404
-------------------------------+----------------------------------------------------------------
                      /lnsig2u |  -2.626849   1.161856                     -4.904045    -.349652
-------------------------------+----------------------------------------------------------------
                       sigma_u |   .2688977   .1562102                      .0861192    .8396031
                           rho |   .0421059   .0468612                      .0044885    .2999886
------------------------------------------------------------------------------------------------

. 
. * ========================================================
. * URBANIZATION AND THE LOCATION OF REVOLUTIONARY EPISODES
. * ========================================================
. clear

. use revolutionaryeps.dta

. ttest urbpercbefrev, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      91    15.42346    1.642528    15.66872    12.16029    18.68663
     yes |     158    27.79544    1.716475    21.57576    24.40507     31.1858
---------+--------------------------------------------------------------------
combined |     249    23.27395    1.297874    20.48011    20.71769    25.83021
---------+--------------------------------------------------------------------
    diff |           -12.37198    2.583319               -17.46012   -7.283835
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -4.7892
Ho: diff = 0                                     degrees of freedom =      247

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. 
. * ========================================================================
. * URBANIZATION MAKING URBAN REVOLTS MORE LIKELY, RURAL REVOLTS LESS LIKELY
. * ========================================================================
. clear

. use revspredictbycntryyr.dta

. xtcloglog urbanrevny lnpopl gdppcthl  polityl polityl2 percurbanl time1 timesq timecub, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     10,575
Group variable: cowcode                         Number of groups  =        157

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         21
                                                              avg =       67.4
                                                              max =        114

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(8)      =     114.20
Log pseudolikelihood  = -714.20385              Prob > chi2       =     0.0000

                              (Std. Err. adjusted for 157 clusters in cowcode)
------------------------------------------------------------------------------
             |               Robust
  urbanrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      lnpopl |   1.303179   .0701204     4.92   0.000     1.172745    1.448121
    gdppcthl |   .9959911   .0305131    -0.13   0.896     .9379466    1.057628
     polityl |   .9252607    .016227    -4.43   0.000     .8939968    .9576179
    polityl2 |   .9830536   .0041064    -4.09   0.000      .975038     .991135
  percurbanl |   1.011543   .0057127     2.03   0.042     1.000408    1.022801
       time1 |   1.021388    .027638     0.78   0.434     .9686296    1.077019
      timesq |   .9992464   .0005074    -1.48   0.138     .9982525    1.000241
     timecub |   1.000005   2.73e-06     1.87   0.062     .9999997     1.00001
       _cons |   .0017428   .0010932   -10.13   0.000     .0005097    .0059593
-------------+----------------------------------------------------------------
    /lnsig2u |  -2.690368   1.834572                     -6.286063     .905327
-------------+----------------------------------------------------------------
     sigma_u |   .2604918   .2389455                      .0431518    1.572495
         rho |   .0396172   .0698012                      .0011307    .6005187
------------------------------------------------------------------------------

. xtcloglog ruralrevny lnpopl gdppcthl  polityl polityl2 percurbanl time1 timesq timecub, vce(robust) nolog eform

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     10,575
Group variable: cowcode                         Number of groups  =        157

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         21
                                                              avg =       67.4
                                                              max =        114

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(8)      =      87.64
Log pseudolikelihood  = -525.11954              Prob > chi2       =     0.0000

                              (Std. Err. adjusted for 157 clusters in cowcode)
------------------------------------------------------------------------------
             |               Robust
  ruralrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      lnpopl |   1.410676   .1061684     4.57   0.000     1.217209    1.634892
    gdppcthl |   .7749647   .0793491    -2.49   0.013      .634055    .9471896
     polityl |   1.015294   .0199602     0.77   0.440     .9769171    1.055179
    polityl2 |   .9937666    .004154    -1.50   0.135     .9856582    1.001942
  percurbanl |   .9818983   .0088522    -2.03   0.043     .9647007    .9994024
       time1 |   .9728913   .0349782    -0.76   0.445     .9066949     1.04392
      timesq |   1.000728   .0007123     1.02   0.306     .9993332    1.002126
     timecub |   .9999956   4.08e-06    -1.07   0.283     .9999876    1.000004
       _cons |   .0014489   .0014228    -6.66   0.000     .0002114    .0099289
-------------+----------------------------------------------------------------
    /lnsig2u |   -.960928   .4743067                     -1.890552   -.0313039
-------------+----------------------------------------------------------------
     sigma_u |   .6184964   .1466785                      .3885723    .9844699
         rho |   .1886772    .072606                      .0840729    .3707492
------------------------------------------------------------------------------

. 
. * =========================================================
. * HIGHER EDUCATION AND OCCUPATION IN THE ORANGE REVOLUTION
. * =========================================================
. clear

. use monitoring20052014engmerged.dta

. logit newpartica age gender highered if EVA_vers=="yr2005", or nolog

Logistic regression                             Number of obs     =      1,799
                                                LR chi2(3)        =      60.75
                                                Prob > chi2       =     0.0000
Log likelihood =  -747.4624                     Pseudo R2         =     0.0391

------------------------------------------------------------------------------
  newpartica | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .9758465   .0040935    -5.83   0.000     .9678563    .9839027
      gender |   1.560687   .2071675     3.35   0.001     1.203168    2.024442
    highered |   1.606793   .2936142     2.60   0.009     1.123097    2.298807
       _cons |   .3987582   .0808514    -4.53   0.000     .2679919    .5933318
------------------------------------------------------------------------------

. margins, atmeans at(highered=(0 1))

Adjusted predictions                            Number of obs     =      1,799
Model VCE    : OIM

Expression   : Pr(newpartica), predict()

1._at        : age             =      45.592 (mean)
               gender          =    .4430239 (mean)
               highered        =           0

2._at        : age             =      45.592 (mean)
               gender          =    .4430239 (mean)
               highered        =           1

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .1374158   .0089035    15.43   0.000     .1199652    .1548663
          2  |   .2038048   .0277225     7.35   0.000     .1494697    .2581399
------------------------------------------------------------------------------

. clear

. use monitoring20052014engmerged.dta

. logit newpartica age gender middleclass student worker skilledworker business farmworker unemployed if EVA_vers=
> ="yr2005", or nolog

Logistic regression                             Number of obs     =      1,774
                                                LR chi2(9)        =      67.77
                                                Prob > chi2       =     0.0000
Log likelihood =  -734.6477                     Pseudo R2         =     0.0441

-------------------------------------------------------------------------------
   newpartica | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
          age |   .9822547    .004817    -3.65   0.000     .9728587    .9917415
       gender |   1.472768   .2072107     2.75   0.006     1.117827    1.940412
  middleclass |    1.70698   .3759409     2.43   0.015     1.108567    2.628421
      student |   2.543328   .7915474     3.00   0.003     1.381933    4.680773
       worker |   1.060318   .3332127     0.19   0.852      .572717    1.963055
skilledworker |   1.218524   .3921297     0.61   0.539      .648502    2.289585
     business |   2.026609   .6144364     2.33   0.020     1.118662    3.671479
   farmworker |   1.752168   .6738772     1.46   0.145     .8245308    3.723442
   unemployed |   1.285844   .3120772     1.04   0.300     .7990973    2.069077
        _cons |   .2583162   .0717338    -4.87   0.000     .1498908    .4451726
-------------------------------------------------------------------------------

. 
. * =========================================================================
. * HIGHER EDUCATION AND OCCUPATION IN THE TUNISIAN AND EGYPTIAN REVOLUTIONS
. * =========================================================================
. clear

. use fullarabbarom2.dta

. logit participate gender q1001 highered if counu==11, or nolog

Logistic regression                             Number of obs     =      1,191
                                                LR chi2(3)        =     149.36
                                                Prob > chi2       =     0.0000
Log likelihood = -451.34854                     Pseudo R2         =     0.1420

------------------------------------------------------------------------------
 participate | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      gender |   5.627239   1.104325     8.80   0.000     3.830454    8.266859
       q1001 |   .9594469   .0061948    -6.41   0.000     .9473817    .9716657
    highered |   1.904452   .3833093     3.20   0.001     1.283656    2.825475
       _cons |   .2616039   .0737751    -4.75   0.000     .1505207    .4546657
------------------------------------------------------------------------------

. margins, atmeans at(highered=(0 1))

Adjusted predictions                            Number of obs     =      1,191
Model VCE    : OIM

Expression   : Pr(participate), predict()

1._at        : gender          =    .5054576 (mean)
               q1001           =    40.13854 (mean)
               highered        =           0

2._at        : gender          =    .5054576 (mean)
               q1001           =    40.13854 (mean)
               highered        =           1

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .1062763    .010941     9.71   0.000     .0848323    .1277202
          2  |   .1846493   .0277317     6.66   0.000     .1302962    .2390023
------------------------------------------------------------------------------

. logit participate gender q1001 professional worker farmer mgmt employee student unemployed if counu==11, or nolo
> g

Logistic regression                             Number of obs     =      1,196
                                                LR chi2(9)        =     168.82
                                                Prob > chi2       =     0.0000
Log likelihood = -442.49279                     Pseudo R2         =     0.1602

------------------------------------------------------------------------------
 participate | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      gender |    4.28234   .9025427     6.90   0.000     2.833235    6.472615
       q1001 |   .9653947   .0073535    -4.62   0.000     .9510891    .9799154
professional |   3.337443   1.609996     2.50   0.012     1.296554    8.590867
      worker |    1.98793    .716084     1.91   0.056     .9812618    4.027332
      farmer |   .5942741   .6391629    -0.48   0.628     .0721921    4.891975
        mgmt |   10.48004   5.602893     4.39   0.000     3.675272    29.88386
    employee |   2.709252   .8977691     3.01   0.003     1.415095    5.186966
     student |   3.670709   1.451934     3.29   0.001     1.690677     7.96965
  unemployed |   2.169328     .75684     2.22   0.026     1.094854    4.298276
       _cons |   .1298414   .0544542    -4.87   0.000     .0570726    .2953921
------------------------------------------------------------------------------

. logit participate gender q1001 highered if counu==7, or nolog

Logistic regression                             Number of obs     =      1,216
                                                LR chi2(3)        =      68.91
                                                Prob > chi2       =     0.0000
Log likelihood =  -303.8433                     Pseudo R2         =     0.1019

------------------------------------------------------------------------------
 participate | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      gender |   3.449698   .8827213     4.84   0.000     2.089164    5.696258
       q1001 |   .9860549   .0083067    -1.67   0.096     .9699077    1.002471
    highered |   3.718979   .8285544     5.90   0.000     2.403167    5.755242
       _cons |   .0456257   .0172448    -8.17   0.000     .0217514    .0957042
------------------------------------------------------------------------------

. margins, atmeans at(highered=(0 1))

Adjusted predictions                            Number of obs     =      1,216
Model VCE    : OIM

Expression   : Pr(participate), predict()

1._at        : gender          =    .5041118 (mean)
               q1001           =    39.48109 (mean)
               highered        =           0

2._at        : gender          =    .5041118 (mean)
               q1001           =    39.48109 (mean)
               highered        =           1

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .0466419   .0069226     6.74   0.000     .0330738    .0602099
          2  |   .1539379   .0241348     6.38   0.000     .1066347    .2012412
------------------------------------------------------------------------------

. logit participate gender q1001 professional worker farmer mgmt employee student unemployed if counu==7, or nolog

Logistic regression                             Number of obs     =      1,219
                                                LR chi2(9)        =      69.19
                                                Prob > chi2       =     0.0000
Log likelihood = -306.39385                     Pseudo R2         =     0.1015

------------------------------------------------------------------------------
 participate | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      gender |   2.393703    .776298     2.69   0.007     1.267706     4.51983
       q1001 |   .9844605   .0094147    -1.64   0.101     .9661799    1.003087
professional |   6.272314   2.716171     4.24   0.000     2.684247     14.6566
      worker |   1.153741   .5752776     0.29   0.774     .4341932     3.06573
      farmer |   .9100759   .5262618    -0.16   0.871     .2929952    2.826797
        mgmt |   4.399425   2.658176     2.45   0.014     1.346144    14.37806
    employee |   3.015212   1.123997     2.96   0.003     1.452148    6.260729
     student |   1.155977   .8344267     0.20   0.841     .2808798    4.757489
  unemployed |   1.260559   .7464972     0.39   0.696     .3948986    4.023841
       _cons |   .0519903   .0235129    -6.54   0.000      .021427    .1261489
------------------------------------------------------------------------------

. 
. * ======================================================================
. * EFFECT OF NUMBER OF PARTICIPANTS ON REPRESSION IN USSR UNDER GLASNOST'
. * ======================================================================
. clear

. use glasnostdemonstrations.dta, clear

. logit repressdum partic [fweight=duration], or nolog

Logistic regression                             Number of obs     =      6,618
                                                LR chi2(1)        =      26.28
                                                Prob > chi2       =     0.0000
Log likelihood = -1617.8189                     Pseudo R2         =     0.0081

------------------------------------------------------------------------------
  repressdum | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      partic |   .9999941   1.71e-06    -3.44   0.001     .9999908    .9999975
       _cons |   .0784383   .0040516   -49.28   0.000      .070886    .0867953
------------------------------------------------------------------------------

. margins, at(partic=(100 500 1000 3000 5000 7000 10000 25000 50000 100000 200000 300000 400000))

Adjusted predictions                            Number of obs     =      6,618
Model VCE    : OIM

Expression   : Pr(repressdum), predict()

1._at        : partic          =         100

2._at        : partic          =         500

3._at        : partic          =        1000

4._at        : partic          =        3000

5._at        : partic          =        5000

6._at        : partic          =        7000

7._at        : partic          =       10000

8._at        : partic          =       25000

9._at        : partic          =       50000

10._at       : partic          =      100000

11._at       : partic          =      200000

12._at       : partic          =      300000

13._at       : partic          =      400000

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .0726937   .0034784    20.90   0.000     .0658761    .0795113
          2  |   .0725356   .0034577    20.98   0.000     .0657586    .0793127
          3  |   .0723385   .0034328    21.07   0.000     .0656104    .0790666
          4  |   .0715549   .0033427    21.41   0.000     .0650032    .0781065
          5  |   .0707791   .0032686    21.65   0.000     .0643727    .0771854
          6  |   .0700111   .0032104    21.81   0.000     .0637187    .0763034
          7  |   .0688735   .0031529    21.84   0.000      .062694     .075053
          8  |   .0634384   .0033247    19.08   0.000     .0569221    .0699547
          9  |   .0552606   .0044392    12.45   0.000     .0465599    .0639613
         10  |   .0417962   .0064993     6.43   0.000     .0290578    .0545346
         11  |   .0236821   .0076046     3.11   0.002     .0087774    .0385868
         12  |   .0133095   .0065423     2.03   0.042     .0004868    .0261322
         13  |   .0074453   .0049373     1.51   0.132    -.0022315    .0171222
------------------------------------------------------------------------------

. 
. * =======================================================================
. * USE OF MASS MEDIA IN REVOLUTIONARY EPISODES IN RURAL AND URBAN SETTINGS
. * =======================================================================
. clear

. use revolutionaryeps.dta

. logit nomedia startyear urbandum if startyear>1899, or nolog

Logistic regression                             Number of obs     =        343
                                                LR chi2(2)        =      95.64
                                                Prob > chi2       =     0.0000
Log likelihood = -131.04254                     Pseudo R2         =     0.2674

------------------------------------------------------------------------------
     nomedia | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   startyear |   .9752629    .004879    -5.01   0.000     .9657471    .9848725
    urbandum |   .0799072    .031278    -6.46   0.000     .0371023    .1720962
       _cons |   1.24e+21   1.21e+22     4.97   0.000     5.95e+12    2.59e+29
------------------------------------------------------------------------------

. margins, atmeans at(urbandum=(0 1))

Adjusted predictions                            Number of obs     =        343
Model VCE    : OIM

Expression   : Pr(nomedia), predict()

1._at        : startyear       =    1963.443 (mean)
               urbandum        =           0

2._at        : startyear       =    1963.443 (mean)
               urbandum        =           1

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .3518055   .0409023     8.60   0.000     .2716385    .4319725
          2  |   .0415667   .0144252     2.88   0.004     .0132938    .0698396
------------------------------------------------------------------------------

. logit newspaperused startyear urbandum, or nolog

Logistic regression                             Number of obs     =        345
                                                LR chi2(2)        =      29.15
                                                Prob > chi2       =     0.0000
Log likelihood = -207.04311                     Pseudo R2         =     0.0658

-------------------------------------------------------------------------------
newspaperused | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
    startyear |   1.000828   .0035702     0.23   0.816     .9938553     1.00785
     urbandum |   3.485013   .8473163     5.13   0.000     2.163966    5.612525
        _cons |   .2101186   1.467347    -0.22   0.823     2.39e-07    184827.1
-------------------------------------------------------------------------------

. margins, atmeans at(urbandum=(0 1))

Adjusted predictions                            Number of obs     =        345
Model VCE    : OIM

Expression   : Pr(newspaperused), predict()

1._at        : startyear       =     1963.07 (mean)
               urbandum        =           0

2._at        : startyear       =     1963.07 (mean)
               urbandum        =           1

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .5163732   .0392606    13.15   0.000     .4394239    .5933226
          2  |   .7881797    .030632    25.73   0.000     .7281421    .8482174
------------------------------------------------------------------------------

. logit radioused startyear urbandum if startyear>1929, or nolog

Logistic regression                             Number of obs     =        262
                                                LR chi2(2)        =       0.18
                                                Prob > chi2       =     0.9138
Log likelihood = -181.23955                     Pseudo R2         =     0.0005

------------------------------------------------------------------------------
   radioused | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   startyear |   .9986136   .0053035    -0.26   0.794     .9882729    1.009063
    urbandum |   .9273629   .2327664    -0.30   0.764     .5670217      1.5167
       _cons |   17.77723    186.478     0.27   0.784     2.09e-08    1.51e+10
------------------------------------------------------------------------------

. margins, atmeans at(urbandum=(0 1))

Adjusted predictions                            Number of obs     =        262
Model VCE    : OIM

Expression   : Pr(radioused), predict()

1._at        : startyear       =    1977.985 (mean)
               urbandum        =           0

2._at        : startyear       =    1977.985 (mean)
               urbandum        =           1

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .5333887   .0465186    11.47   0.000     .4422139    .6245636
          2  |   .5145818   .0415059    12.40   0.000     .4332316    .5959319
------------------------------------------------------------------------------

. logit televisused startyear urbandum if startyear>1964, or nolog

Logistic regression                             Number of obs     =        179
                                                LR chi2(2)        =      41.78
                                                Prob > chi2       =     0.0000
Log likelihood = -86.976418                     Pseudo R2         =     0.1937

------------------------------------------------------------------------------
 televisused | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   startyear |   1.046612   .0146612     3.25   0.001     1.018267    1.075745
    urbandum |   7.975184    3.82599     4.33   0.000     3.114497    20.42177
       _cons |   3.43e-41   9.60e-40    -3.33   0.001     5.46e-65    2.16e-17
------------------------------------------------------------------------------

. margins, atmeans at(urbandum=(0 1))

Adjusted predictions                            Number of obs     =        179
Model VCE    : OIM

Expression   : Pr(televisused), predict()

1._at        : startyear       =    1991.156 (mean)
               urbandum        =           0

2._at        : startyear       =    1991.156 (mean)
               urbandum        =           1

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .0787678   .0317671     2.48   0.013     .0165055      .14103
          2  |    .405434   .0510925     7.94   0.000     .3052946    .5055734
------------------------------------------------------------------------------

. logit socialmediaused startyear urbandum if startyear>1989, or nolog

Logistic regression                             Number of obs     =         97
                                                LR chi2(2)        =      42.44
                                                Prob > chi2       =     0.0000
Log likelihood =  -45.39082                     Pseudo R2         =     0.3186

---------------------------------------------------------------------------------
socialmediaused | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
      startyear |   1.202371   .0447092     4.96   0.000      1.11786    1.293272
       urbandum |   3.036398   1.723303     1.96   0.050     .9982987    9.235425
          _cons |   1.8e-161   1.4e-159    -4.96   0.000     5.9e-225    5.58e-98
---------------------------------------------------------------------------------

. margins, atmeans at(urbandum=(0 1))

Adjusted predictions                            Number of obs     =         97
Model VCE    : OIM

Expression   : Pr(socialmediaused), predict()

1._at        : startyear       =     2001.99 (mean)
               urbandum        =           0

2._at        : startyear       =     2001.99 (mean)
               urbandum        =           1

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .2389047   .0881734     2.71   0.007     .0660881    .4117214
          2  |   .4879969   .0798833     6.11   0.000     .3314284    .6445653
------------------------------------------------------------------------------

. 
. * ======================================
. * VARIOUS T-TESTS AND OTHER TESTS CITED
. * ======================================
. clear

. use revolutionaryeps.dta

. ttest urbpercbefrev if startyear>1899, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      91    15.42346    1.642528    15.66872    12.16029    18.68663
     yes |     158    27.79544    1.716475    21.57576    24.40507     31.1858
---------+--------------------------------------------------------------------
combined |     249    23.27395    1.297874    20.48011    20.71769    25.83021
---------+--------------------------------------------------------------------
    diff |           -12.37198    2.583319               -17.46012   -7.283835
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -4.7892
Ho: diff = 0                                     degrees of freedom =      247

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. ttest litpercbefrev if startyear>1899, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      65    34.47385    2.904216    23.41454    28.67201    40.27569
     yes |     145    63.50069    2.575273     31.0104    58.41047    68.59091
---------+--------------------------------------------------------------------
combined |     210    54.51619    2.194564    31.80225    50.18987    58.84251
---------+--------------------------------------------------------------------
    diff |           -29.02684    4.311887               -37.52745   -20.52624
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -6.7318
Ho: diff = 0                                     degrees of freedom =      208

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. ttest newspercap if startyear>1964, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      36      218.75    46.16756    277.0054    125.0249    312.4751
     yes |      49    1093.776    205.0055    1435.038    681.5844    1505.967
---------+--------------------------------------------------------------------
combined |      85    723.1765    128.2415    1182.328    468.1542    978.1987
---------+--------------------------------------------------------------------
    diff |           -875.0255    242.7874                -1357.92   -392.1311
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -3.6041
Ho: diff = 0                                     degrees of freedom =       83

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0003         Pr(|T| > |t|) = 0.0005          Pr(T > t) = 0.9997

. ttest radiospercap if startyear>1929, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      43    979.0698    132.2698    867.3512    712.1385    1246.001
     yes |      67    2950.493    1016.114    8317.253     921.755     4979.23
---------+--------------------------------------------------------------------
combined |     110    2179.845    626.0304    6565.863    939.0735    3420.617
---------+--------------------------------------------------------------------
    diff |           -1971.423    1274.859               -4498.415    555.5699
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -1.5464
Ho: diff = 0                                     degrees of freedom =      108

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0625         Pr(|T| > |t|) = 0.1249          Pr(T > t) = 0.9375

. ttest televispercap if startyear>1899, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      45    1883.444    509.6588    3418.895    856.2946    2910.594
     yes |      67    10675.24    1839.858    15059.89    7001.843    14348.63
---------+--------------------------------------------------------------------
combined |     112    7142.821    1188.611    12579.08    4787.508    9498.134
---------+--------------------------------------------------------------------
    diff |           -8791.794    2286.643               -13323.38   -4260.205
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -3.8448
Ho: diff = 0                                     degrees of freedom =      110

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0001         Pr(|T| > |t|) = 0.0002          Pr(T > t) = 0.9999

. ttest newinternetuse if startyear>1989, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      14     5.31785    2.195761    8.215784     .574198     10.0615
     yes |      45    16.43694    2.782647    18.66656    10.82888      22.045
---------+--------------------------------------------------------------------
combined |      59    13.79851    2.263284    17.38461    9.268056    18.32897
---------+--------------------------------------------------------------------
    diff |           -11.11909    5.160535               -21.45288   -.7852942
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -2.1546
Ho: diff = 0                                     degrees of freedom =       57

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0177         Pr(|T| > |t|) = 0.0354          Pr(T > t) = 0.9823

. tab urbandum revwaveny, row chi

+----------------+
| Key            |
|----------------|
|   frequency    |
| row percentage |
+----------------+

   Episode |
  occurred |
 primarily | Part of trasnational
     in an |   wave? [loose def,
     urban |    broad families]
   setting |        no        yes |     Total
-----------+----------------------+----------
        no |        94         71 |       165 
           |     56.97      43.03 |    100.00 
-----------+----------------------+----------
       yes |        66        114 |       180 
           |     36.67      63.33 |    100.00 
-----------+----------------------+----------
     Total |       160        185 |       345 
           |     46.38      53.62 |    100.00 

          Pearson chi2(1) =  14.2694   Pr = 0.000

. ttest mtnest if startyear>1899, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |     134    19.26045    1.772317    20.51605    15.75488    22.76603
     yes |     167    18.68191    1.535086    19.83769    15.65111    21.71272
---------+--------------------------------------------------------------------
combined |     301    18.93947    1.159163    20.11072    16.65835    21.22059
---------+--------------------------------------------------------------------
    diff |            .5785387    2.336042               -4.018628    5.175706
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =   0.2477
Ho: diff = 0                                     degrees of freedom =      299

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.5977         Pr(|T| > |t|) = 0.8046          Pr(T > t) = 0.4023

. ttest politymin1 if startyear>1899, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |     114   -.6929825    .5674676    6.058896   -1.817238    .4312731
     yes |     158   -2.063291    .4549958    5.719208   -2.961994   -1.164588
---------+--------------------------------------------------------------------
combined |     272   -1.488971    .3572554    5.892007   -2.192319   -.7856218
---------+--------------------------------------------------------------------
    diff |            1.370309    .7205769               -.0483551    2.788972
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =   1.9017
Ho: diff = 0                                     degrees of freedom =      270

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9709         Pr(|T| > |t|) = 0.0583          Pr(T > t) = 0.0291

. ttest politymin1 if startyear>1899 & (urbancivic==1 | leftist==1), by(urbancivic)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      64      .09375    .8139772    6.511818   -1.532854    1.720354
     yes |      53   -2.641509    .7761383    5.650372   -4.198945   -1.084074
---------+--------------------------------------------------------------------
combined |     117   -1.145299    .5789134    6.261906    -2.29191    .0013118
---------+--------------------------------------------------------------------
    diff |            2.735259    1.139834                .4774678    4.993051
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =   2.3997
Ho: diff = 0                                     degrees of freedom =      115

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9910         Pr(|T| > |t|) = 0.0180          Pr(T > t) = 0.0090

. ttest incumbpowerdur if startyear>1899, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |     163    5.754601    .6226732    7.949759    4.524999    6.984204
     yes |     178     8.41573    .6838368     9.12352    7.066208    9.765253
---------+--------------------------------------------------------------------
combined |     341    7.143695    .4696587    8.672804    6.219893    8.067498
---------+--------------------------------------------------------------------
    diff |           -2.661129    .9304545               -4.491321   -.8309376
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -2.8600
Ho: diff = 0                                     degrees of freedom =      339

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0022         Pr(|T| > |t|) = 0.0045          Pr(T > t) = 0.9978

. ttest incumbpowerdur if startyear>1899 & (leftist==1 | urbancivic==1), by(urbancivic)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      80      6.8625    1.081306    9.671495    4.710214    9.014786
     yes |      54    11.61111    1.289482    9.475722    9.024737    14.19749
---------+--------------------------------------------------------------------
combined |     134    8.776119    .8499633    9.839037    7.094925    10.45731
---------+--------------------------------------------------------------------
    diff |           -4.748611    1.689591                -8.09079   -1.406432
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -2.8105
Ho: diff = 0                                     degrees of freedom =      132

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0028         Pr(|T| > |t|) = 0.0057          Pr(T > t) = 0.9972

. ttest vdpolcorrmin1 if startyear>1899, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |     102      .60224    .0230737    .2330324    .5564681    .6480119
     yes |     150    .5726573    .0199818    .2447257     .533173    .6121415
---------+--------------------------------------------------------------------
combined |     252    .5846312    .0151207    .2400329    .5548517    .6144108
---------+--------------------------------------------------------------------
    diff |            .0295827    .0308101               -.0310977    .0902631
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =   0.9602
Ho: diff = 0                                     degrees of freedom =      250

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.8310         Pr(|T| > |t|) = 0.3379          Pr(T > t) = 0.1690

. ttest vdpolcorrmin1 if startyear>1899 & (urbancivic==1 | leftist==1), by(urbancivic)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      68    .4911733    .0285226    .2352036    .4342419    .5481047
     yes |      48    .6750566    .0322599     .223503    .6101581    .7399551
---------+--------------------------------------------------------------------
combined |     116     .567263    .0229165    .2468187    .5218697    .6126562
---------+--------------------------------------------------------------------
    diff |           -.1838833    .0434444               -.2699463   -.0978202
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -4.2326
Ho: diff = 0                                     degrees of freedom =      114

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. ttest statecapacity if startyear>1899, by(urbandum)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      46   -.9762033     .091197     .618528   -1.159883   -.7925232
     yes |      75   -.2328294    .0917642    .7947009   -.4156734   -.0499853
---------+--------------------------------------------------------------------
combined |     121   -.5154344    .0740908    .8149985   -.6621289   -.3687398
---------+--------------------------------------------------------------------
    diff |            -.743374    .1372878               -1.015218   -.4715304
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =  -5.4147
Ho: diff = 0                                     degrees of freedom =      119

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. ttest statecapacity=0 if startyear>1899 & urbandum==0

One-sample t test
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
statec~y |      46   -.9762033     .091197     .618528   -1.159883   -.7925232
------------------------------------------------------------------------------
    mean = mean(statecapacity)                                    t = -10.7043
Ho: mean = 0                                     degrees of freedom =       45

    Ha: mean < 0                 Ha: mean != 0                 Ha: mean > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. ttest statecapacity=0 if startyear>1899 & leftist==1

One-sample t test
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
statec~y |      32   -.5893211    .1220483    .6904096   -.8382404   -.3404019
------------------------------------------------------------------------------
    mean = mean(statecapacity)                                    t =  -4.8286
Ho: mean = 0                                     degrees of freedom =       31

    Ha: mean < 0                 Ha: mean != 0                 Ha: mean > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. ttest statecapacity=0 if startyear>1899 & urbandum==1

One-sample t test
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
statec~y |      75   -.2328294    .0917642    .7947009   -.4156734   -.0499853
------------------------------------------------------------------------------
    mean = mean(statecapacity)                                    t =  -2.5373
Ho: mean = 0                                     degrees of freedom =       74

    Ha: mean < 0                 Ha: mean != 0                 Ha: mean > 0
 Pr(T < t) = 0.0066         Pr(|T| > |t|) = 0.0133          Pr(T > t) = 0.9934

. ttest statecapacity if startyear>1899 & urbandum==0, by(success)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      29   -.8421359    .1134091    .6107269   -1.074444   -.6098278
     yes |      17   -1.204907    .1404022    .5788933   -1.502546   -.9072672
---------+--------------------------------------------------------------------
combined |      46   -.9762033     .091197     .618528   -1.159883   -.7925232
---------+--------------------------------------------------------------------
    diff |            .3627708    .1830769               -.0061965    .7317381
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =   1.9815
Ho: diff = 0                                     degrees of freedom =       44

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9731         Pr(|T| > |t|) = 0.0538          Pr(T > t) = 0.0269

. ttest statecapacity if startyear>1899 & urbancivic==1, by(success)

Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
      no |      14   -.1313657    .1791624    .6703642   -.5184225     .255691
     yes |      22   -.2747413    .1833565    .8600181   -.6560519    .1065694
---------+--------------------------------------------------------------------
combined |      36   -.2189841    .1307796    .7846778   -.4844809    .0465126
---------+--------------------------------------------------------------------
    diff |            .1433755    .2710706               -.4075062    .6942572
------------------------------------------------------------------------------
    diff = mean(no) - mean(yes)                                   t =   0.5289
Ho: diff = 0                                     degrees of freedom =       34

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.6999         Pr(|T| > |t|) = 0.6003          Pr(T > t) = 0.3001

. 
. * ======================
. * POLITICAL OPPORTUNITY
. * ======================
. tab urbandum polopportunity if startyear>1899, row chi

+----------------+
| Key            |
|----------------|
|   frequency    |
| row percentage |
+----------------+

   Episode |
  occurred |
 primarily |  Period of political
     in an | opportunity (election
     urban |    or pol reform)?
   setting |        no        yes |     Total
-----------+----------------------+----------
        no |       141         22 |       163 
           |     86.50      13.50 |    100.00 
-----------+----------------------+----------
       yes |       116         64 |       180 
           |     64.44      35.56 |    100.00 
-----------+----------------------+----------
     Total |       257         86 |       343 
           |     74.93      25.07 |    100.00 

          Pearson chi2(1) =  22.1554   Pr = 0.000

. tab urbancivic polopportunity if startyear>1899, row chi

+----------------+
| Key            |
|----------------|
|   frequency    |
| row percentage |
+----------------+

           |  Period of political
     Urban | opportunity (election
     civic |    or pol reform)?
   episode |        no        yes |     Total
-----------+----------------------+----------
        no |       236         53 |       289 
           |     81.66      18.34 |    100.00 
-----------+----------------------+----------
       yes |        21         33 |        54 
           |     38.89      61.11 |    100.00 
-----------+----------------------+----------
     Total |       257         86 |       343 
           |     74.93      25.07 |    100.00 

          Pearson chi2(1) =  44.3071   Pr = 0.000

. tab urbancivic success if startyear>1899 & polopportunity==1, row chi

+----------------+
| Key            |
|----------------|
|   frequency    |
| row percentage |
+----------------+

     Urban | Succeeded in gaining
     civic |        power?
   episode |        no        yes |     Total
-----------+----------------------+----------
        no |        33         20 |        53 
           |     62.26      37.74 |    100.00 
-----------+----------------------+----------
       yes |        12         21 |        33 
           |     36.36      63.64 |    100.00 
-----------+----------------------+----------
     Total |        45         41 |        86 
           |     52.33      47.67 |    100.00 

          Pearson chi2(1) =   5.4690   Pr = 0.019

. tab urbandum success if startyear>1899 & polopportunity==1, row chi

+----------------+
| Key            |
|----------------|
|   frequency    |
| row percentage |
+----------------+

   Episode |
  occurred |
 primarily |
     in an | Succeeded in gaining
     urban |        power?
   setting |        no        yes |     Total
-----------+----------------------+----------
        no |        14          8 |        22 
           |     63.64      36.36 |    100.00 
-----------+----------------------+----------
       yes |        31         33 |        64 
           |     48.44      51.56 |    100.00 
-----------+----------------------+----------
     Total |        45         41 |        86 
           |     52.33      47.67 |    100.00 

          Pearson chi2(1) =   1.5161   Pr = 0.218

. 
. * =======================================
. * RELATIONSHIP OF URBAN/RURAL TO TIME SINCE INDEPENDENCE
. * =======================================
. clear

. use revspredictbycntryyr.dta

. xtcloglog ruralrevny lnyrsindependent time1 timesq timecub, nolog eform vce(robust)

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     11,968
Group variable: cowcode                         Number of groups  =        158

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         10
                                                              avg =       75.7
                                                              max =        115

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      15.42
Log pseudolikelihood  = -641.09773              Prob > chi2       =     0.0039

                                  (Std. Err. adjusted for 158 clusters in cowcode)
----------------------------------------------------------------------------------
                 |               Robust
      ruralrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
lnyrsindependent |   .7185092   .0742148    -3.20   0.001     .5868293    .8797372
           time1 |   .9884032   .0294625    -0.39   0.696     .9323122    1.047869
          timesq |   1.000026   .0006087     0.04   0.966     .9988334    1.001219
         timecub |          1   3.54e-06     0.12   0.906     .9999935    1.000007
           _cons |   .0272794   .0135632    -7.24   0.000     .0102948    .0722853
-----------------+----------------------------------------------------------------
        /lnsig2u |   .3739908   .2425641                      -.101426    .8494076
-----------------+----------------------------------------------------------------
         sigma_u |   1.205622   .1462203                      .9505514    1.529137
             rho |    .469112   .0604096                      .3545436    .5870315
----------------------------------------------------------------------------------

. xtcloglog urbanrevny lnyrsindependent time1 timesq timecub, nolog eform vce(robust)

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     11,968
Group variable: cowcode                         Number of groups  =        158

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         10
                                                              avg =       75.7
                                                              max =        115

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      11.93
Log pseudolikelihood  = -793.73485              Prob > chi2       =     0.0179

                                  (Std. Err. adjusted for 158 clusters in cowcode)
----------------------------------------------------------------------------------
                 |               Robust
      urbanrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
lnyrsindependent |   1.160004   .1312918     1.31   0.190     .9292206    1.448106
           time1 |   1.004007   .0244384     0.16   0.869     .9572336    1.053067
          timesq |   .9996922   .0004812    -0.64   0.522     .9987496    1.000636
         timecub |   1.000003   2.67e-06     1.00   0.316     .9999974    1.000008
           _cons |   .0060795   .0036393    -8.52   0.000     .0018807    .0196525
-----------------+----------------------------------------------------------------
        /lnsig2u |  -.8459687   .3454424                     -1.523023   -.1689141
-----------------+----------------------------------------------------------------
         sigma_u |   .6550889   .1131477                        .46696    .9190111
             rho |   .2069073    .056686                      .1170442    .3392554
----------------------------------------------------------------------------------

. 
. * =======================================================
. * RELATIONSHIP TO EFFECTIVE TERRITORIAL CONTROL OF STATES
. * =======================================================
. xtcloglog ruralrevny v2svstterr time1 timesq timecub, nolog eform vce(robust)

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     11,432
Group variable: cowcode                         Number of groups  =        162

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          6
                                                              avg =       70.6
                                                              max =        114

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      65.59
Log pseudolikelihood  = -592.52389              Prob > chi2       =     0.0000

                              (Std. Err. adjusted for 162 clusters in cowcode)
------------------------------------------------------------------------------
             |               Robust
  ruralrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  v2svstterr |   .9572811   .0064818    -6.45   0.000     .9446609    .9700699
       time1 |   .9902208   .0301454    -0.32   0.747     .9328651    1.051103
      timesq |   1.000274   .0005976     0.46   0.647     .9991031    1.001446
     timecub |   .9999982   3.42e-06    -0.53   0.593     .9999915    1.000005
       _cons |   .2780883   .1625841    -2.19   0.029     .0884155    .8746553
-------------+----------------------------------------------------------------
    /lnsig2u |   .0091052   .3199286                     -.6179434    .6361538
-------------+----------------------------------------------------------------
     sigma_u |   1.004563   .1606942                      .7342016    1.374482
         rho |   .3802246   .0753924                      .2468202    .5345582
------------------------------------------------------------------------------

. xtcloglog urbanrevny v2svstterr time1 timesq timecub, nolog eform vce(robust)

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     11,432
Group variable: cowcode                         Number of groups  =        162

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          6
                                                              avg =       70.6
                                                              max =        114

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =       7.83
Log pseudolikelihood  = -774.64902              Prob > chi2       =     0.0982

                              (Std. Err. adjusted for 162 clusters in cowcode)
------------------------------------------------------------------------------
             |               Robust
  urbanrevny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  v2svstterr |   .9957196   .0072492    -0.59   0.556     .9816124     1.01003
       time1 |    1.01334   .0263815     0.51   0.611     .9629298    1.066388
      timesq |     .99953    .000491    -0.96   0.339     .9985682    1.000493
     timecub |   1.000003   2.66e-06     1.30   0.193     .9999982    1.000009
       _cons |   .0142464    .009945    -6.09   0.000     .0036266    .0559634
-------------+----------------------------------------------------------------
    /lnsig2u |  -.6823653   .3368775                     -1.342633   -.0220976
-------------+----------------------------------------------------------------
     sigma_u |   .7109291    .119748                      .5110354     .989012
         rho |   .2350404   .0605694                      .1370119    .3728995
------------------------------------------------------------------------------

. 
. * ==============================================================
. * COUNTRY EXTERNAL BATTLE DEATHS AND ONSET OF SOCIAL REVOLUTIONS
. * ==============================================================
. xtcloglog leftistny lnextwardeathsl time1 timesq timecub if colony==0, vce(robust) eform nolog

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     13,196
Group variable: cowcode                         Number of groups  =        165

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         10
                                                              avg =       80.0
                                                              max =        115

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      28.32
Log pseudolikelihood  = -391.63832              Prob > chi2       =     0.0000

                                 (Std. Err. adjusted for 165 clusters in cowcode)
---------------------------------------------------------------------------------
                |               Robust
      leftistny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
lnextwardeathsl |    1.09749   .0453544     2.25   0.024     1.012101    1.190082
          time1 |   .9456729   .0314009    -1.68   0.093     .8860882    1.009264
         timesq |   1.001876   .0007586     2.48   0.013      1.00039    1.003364
        timecub |   .9999844   4.92e-06    -3.17   0.002     .9999748    .9999941
          _cons |   .0058684   .0027486   -10.97   0.000     .0023434    .0146961
----------------+----------------------------------------------------------------
       /lnsig2u |  -.3788576   .4799896                      -1.31962    .5619047
----------------+----------------------------------------------------------------
        sigma_u |   .8274316   .1985793                      .5169496     1.32439
            rho |   .2938916   .0996071                      .1397557    .5160456
---------------------------------------------------------------------------------

. xtcloglog antimonarchny lnextwardeathsl time1 timesq timecub if colony==0, vce(robust) eform nolog

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     13,196
Group variable: cowcode                         Number of groups  =        165

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         10
                                                              avg =       80.0
                                                              max =        115

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      40.26
Log pseudolikelihood  = -158.46593              Prob > chi2       =     0.0000

                                 (Std. Err. adjusted for 165 clusters in cowcode)
---------------------------------------------------------------------------------
                |               Robust
  antimonarchny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
lnextwardeathsl |   1.192516   .0778822     2.70   0.007     1.049236    1.355363
          time1 |   .9090052   .0399768    -2.17   0.030      .833934    .9908344
         timesq |    1.00071   .0008677     0.82   0.413     .9990104    1.002412
        timecub |   .9999993   4.75e-06    -0.16   0.877       .99999    1.000009
          _cons |   .0067493   .0043181    -7.81   0.000     .0019261    .0236506
----------------+----------------------------------------------------------------
       /lnsig2u |   .7742635   .4899894                     -.1860981    1.734625
----------------+----------------------------------------------------------------
        sigma_u |   1.472751   .3608161                      .9111488    2.380505
            rho |   .5687035   .1201845                      .3354141    .7750283
---------------------------------------------------------------------------------

. xtcloglog urbancivicny lnextwardeathsl time1 timesq timecub if colony==0, vce(robust) eform nolog

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     13,196
Group variable: cowcode                         Number of groups  =        165

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         10
                                                              avg =       80.0
                                                              max =        115

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =      28.19
Log pseudolikelihood  = -325.06876              Prob > chi2       =     0.0000

                                 (Std. Err. adjusted for 165 clusters in cowcode)
---------------------------------------------------------------------------------
                |               Robust
   urbancivicny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
lnextwardeathsl |   1.008537   .1101657     0.08   0.938      .814165    1.249313
          time1 |   .9147193   .0704842    -1.16   0.247     .7864987    1.063843
         timesq |   1.002306   .0013173     1.75   0.080     .9997275    1.004891
        timecub |   .9999886   6.68e-06    -1.71   0.087     .9999755    1.000002
          _cons |   .0006051   .0009914    -4.52   0.000     .0000244    .0150124
----------------+----------------------------------------------------------------
       /lnsig2u |  -3.283571   6.278825                     -15.58984      9.0227
----------------+----------------------------------------------------------------
        sigma_u |    .193634    .607897                      .0004118    91.04467
            rho |   .0222857   .1368097                      1.03e-07    .9998016
---------------------------------------------------------------------------------

. xtcloglog independny lnextwardeathsl  time1 timesq timecub , vce(robust) eform nolog

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     18,278
Group variable: cowcode                         Number of groups  =        165

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         21
                                                              avg =      110.8
                                                              max =        115

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =       3.93
Log pseudolikelihood  = -653.51109              Prob > chi2       =     0.4154

                                 (Std. Err. adjusted for 165 clusters in cowcode)
---------------------------------------------------------------------------------
                |               Robust
     independny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
lnextwardeathsl |   1.020806   .0395431     0.53   0.595     .9461718    1.101327
          time1 |   1.002927     .02363     0.12   0.901      .957666    1.050327
         timesq |    .999957   .0004906    -0.09   0.930      .998996    1.000919
        timecub |   .9999996   2.88e-06    -0.12   0.901      .999994    1.000005
          _cons |    .003869   .0014448   -14.87   0.000      .001861     .008044
----------------+----------------------------------------------------------------
       /lnsig2u |   .1748396    .285066                     -.3838796    .7335587
----------------+----------------------------------------------------------------
        sigma_u |   1.091355   .1555541                      .8253566    1.443079
            rho |   .4199787   .0694411                      .2928505    .5586928
---------------------------------------------------------------------------------

. xtcloglog ethnicorderny lnextwardeathsl time1 timesq timecub if colony==0, vce(robust) eform nolog

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =     13,196
Group variable: cowcode                         Number of groups  =        165

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         10
                                                              avg =       80.0
                                                              max =        115

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =       7.02
Log pseudolikelihood  = -300.48582              Prob > chi2       =     0.1348

                                 (Std. Err. adjusted for 165 clusters in cowcode)
---------------------------------------------------------------------------------
                |               Robust
  ethnicorderny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
lnextwardeathsl |   .9431512   .1107334    -0.50   0.618     .7492789    1.187187
          time1 |   1.112526   .1413807     0.84   0.401     .8672392    1.427189
         timesq |   .9985973   .0018759    -0.75   0.455     .9949274    1.002281
        timecub |   1.000007   8.78e-06     0.75   0.453     .9999894    1.000024
          _cons |   .0000701   .0001913    -3.50   0.000     3.33e-07    .0147599
----------------+----------------------------------------------------------------
       /lnsig2u |   .9055379   .2977726                      .3219143    1.489161
----------------+----------------------------------------------------------------
        sigma_u |   1.572661   .2341477                      1.174635    2.105558
            rho |   .6005693   .0714314                      .4561663    .7293764
---------------------------------------------------------------------------------

. 
. * ================================================================
. * FINANCIAL CRISIS AND ONSET OF URBAN CIVIC AND SOCIAL REVOLUTIONS
. * ================================================================
. xtcloglog urbancivicny rrfinstressl time1 timesq timecub if colony==0, vce(robust) eform nolog

Calculating robust standard errors:

Random-effects complementary log-log model      Number of obs     =      6,420
Group variable: cowcode                         Number of groups  =         68

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =         37
                                                              avg =       94.4
                                                              max =        111

Integration method: mvaghermite                 Integration pts.  =         12

                                                Wald chi2(4)      =       8.87
Log pseudolikelihood  = -122.51061              Prob > chi2       =     0.0645

                               (Std. Err. adjusted for 68 clusters in cowcode)
------------------------------------------------------------------------------
             |               Robust
urbancivicny |     exp(b)   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
rrfinstressl |   1.034623   .2457363     0.14   0.886     .6495474    1.647986
       time1 |   .9452195   .0796752    -0.67   0.504     .8012768     1.11502
      timesq |   1.001778   .0016755     1.06   0.288     .9984997    1.005067
     timecub |   .9999901   9.50e-06    -1.04   0.300     .9999715    1.000009
       _cons |   .0005229   .0008096    -4.88   0.000     .0000251    .0108742
-------------+----------------------------------------------------------------
    /lnsig2u |  -.7125539   .9242476                     -2.524046    1.098938
-------------+----------------------------------------------------------------
     sigma_u |   .7002787   .3236154                      .2830808    1.732333
         rho |   .2296561   .1635125                      .0464531    .6459395
------------------------------------------------------------------------------

. 
. * ======================================================================
. * DIFFUSION OF REVOLUTION AND URBAN/URBAN CIVIC REVOLUTIONARY CONTENTION
. * ======================================================================
. clear

. use revolutionaryeps.dta

. logit revwaveny urbandum startyear if startyear>1899, or

Iteration 0:   log likelihood =  -236.8376  
Iteration 1:   log likelihood = -228.23446  
Iteration 2:   log likelihood = -228.22575  
Iteration 3:   log likelihood = -228.22575  

Logistic regression                             Number of obs     =        343
                                                LR chi2(2)        =      17.22
                                                Prob > chi2       =     0.0002
Log likelihood = -228.22575                     Pseudo R2         =     0.0364

------------------------------------------------------------------------------
   revwaveny | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    urbandum |   2.454927   .5563925     3.96   0.000     1.574416    3.827874
   startyear |    .994335   .0033735    -1.67   0.094      .987745    1.000969
       _cons |      50846   337702.9     1.63   0.103     .1129398    2.29e+10
------------------------------------------------------------------------------

. margins, at(urbandum=(0 1))

Predictive margins                              Number of obs     =        343
Model VCE    : OIM

Expression   : Pr(revwaveny), predict()

1._at        : urbandum        =           0

2._at        : urbandum        =           1

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .4218157   .0386727    10.91   0.000     .3460186    .4976129
          2  |   .6399015   .0357046    17.92   0.000     .5699218    .7098812
------------------------------------------------------------------------------

. logit revwaveny urbancivic startyear if startyear>1899, or

Iteration 0:   log likelihood =  -236.8376  
Iteration 1:   log likelihood = -221.31957  
Iteration 2:   log likelihood = -221.23303  
Iteration 3:   log likelihood = -221.23301  
Iteration 4:   log likelihood = -221.23301  

Logistic regression                             Number of obs     =        343
                                                LR chi2(2)        =      31.21
                                                Prob > chi2       =     0.0000
Log likelihood = -221.23301                     Pseudo R2         =     0.0659

------------------------------------------------------------------------------
   revwaveny | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  urbancivic |   7.162878   2.847865     4.95   0.000     3.285951    15.61399
   startyear |   .9888297   .0036327    -3.06   0.002     .9817354    .9959753
       _cons |   3.33e+09   2.40e+10     3.05   0.002     2517.738    4.41e+15
------------------------------------------------------------------------------

. margins, at(urbancivic=(0 1))

Predictive margins                              Number of obs     =        343
Model VCE    : OIM

Expression   : Pr(revwaveny), predict()

1._at        : urbancivic      =           0

2._at        : urbancivic      =           1

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         _at |
          1  |   .4686066   .0292061    16.04   0.000     .4113636    .5258496
          2  |   .8569775   .0436926    19.61   0.000     .7713415    .9426135
------------------------------------------------------------------------------

. 
. log close
      name:  <unnamed>
       log:  C:\Users\mbeissin\Desktop\Stata files for book\Logfiles\chapter2.log
  log type:  text
 closed on:  25 Jan 2022, 19:19:48
------------------------------------------------------------------------------------------------------------------
